/* 
 * File:   Frame.h
 * Author: amouro-m
 *
 * Created on 30 mai 2010, 18:51
 */

#ifndef _FRAME_H
#define	_FRAME_H

#include <QWidget>
#include "tbb/pipeline.h"

#include "FractalView.h"
#include "ResultPanel.h"
#include "Filtre.hpp"
#include "Fractal.hpp"
#include "FractalPrinter.h"
#include "InformationPanel.h"
#include "Computable.h"
#include "LinearFilter.h"
#include <vector>

class Frame:public QWidget {
    Q_OBJECT
    
public:
    Frame(unsigned int width, unsigned int hight, QWidget *parent=0);
    virtual ~Frame();

    FractalView* get_fractal_view() const;
    ResultPanel* get_chrono() const;

    void set_fractal(Fractal* fractal);
    void set_fractal_julia();
    void set_bruitdeperlin();
    void set_fractal_mendel();

    void set_printer_normal();
    void set_printer_inversex();
    void set_printer_inversey();
    void set_printer_inversexy();

    void set_filtre_NB();
    void set_filtre_Red();
    void set_filtre_Green();
    void set_filtre_Blue();
    void set_filtre_Flou();

private slots:
    void compute();

private:
    ResultPanel* _result_panel_parallel;
    FractalView* _fractal_view_parallel;
    FractalView* _fractal_view_linear;
    ResultPanel* _result_panel_linear;
    InformationPanel* _information_panel;
    std::vector<LinearFilter*> _linear_filter_list;
    tbb::pipeline* _pipline;

    void apply_fractal();
    void add_action(Computable* item);
};

#endif	/* _FRAME_H */

